import {
    postMethod,
    getMethod
} from './axios.js'

export default {
    init(typeid) {
        return getMethod("/api/note/index", {
            typeid: typeid
        })
    },
    page(typeid, page) {
        return getMethod("/api/note/page", {
            typeid: typeid,
            page: page == null ? 1 : page
        })
    },
    select(key, page) {
        return getMethod("/api/note/note/select", {
            select: key,
            page: page == null ? 1 : page
        })
    },
    detialById(noteId) {
        return getMethod("/api/note/note", {
            noteid: noteId,
        })
    },
    comments(noteId, page) {
        return getMethod("/api/note/comment", {
            noteid: noteId,
            page: page
        })
    },
    createNote(text, title, typeid) {
        return postMethod("/api/user/note/create", {
            text: text,
            tittle: title,
            typeid: typeid
        })
    }
}